
import java.util.ArrayList;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ChooseUserScreen.java
 *
 * Created on Dec 13, 2011, 1:25:00 AM
 */

/**
 *
 * @author dabeast23
 */
public class ChooseUserScreen extends javax.swing.JFrame {

    /** Creates new form ChooseUserScreen */
    public ChooseUserScreen(ArrayList reservationList) {
        setResizable(false);
	setTitle("Hotel Kiosk: Choose User");
	setDefaultCloseOperation(this.EXIT_ON_CLOSE);
        initComponents();
        this.reservationList = reservationList;
        this.setLocationRelativeTo(null);
    }
    
    public ChooseUserScreen() {
        setResizable(false);
	setTitle("Hotel Kiosk: Choose User");
	setDefaultCloseOperation(this.EXIT_ON_CLOSE);
        initComponents();
        this.setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        backgroundPanel = new javax.swing.JPanel();
        prospectiveGuestButton = new javax.swing.JButton();
        currentGuestButton = new javax.swing.JButton();
        employeeButton = new javax.swing.JButton();
        separator = new javax.swing.JSeparator();
        chooseUserLabel = new javax.swing.JLabel();
        backButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));

        backgroundPanel.setBackground(new java.awt.Color(102, 0, 0));

        prospectiveGuestButton.setBackground(new java.awt.Color(255, 255, 204));
        prospectiveGuestButton.setFont(new java.awt.Font("Comic Sans MS", 0, 18));
        prospectiveGuestButton.setForeground(new java.awt.Color(102, 0, 0));
        prospectiveGuestButton.setText("Prospective Guest");
        prospectiveGuestButton.setBorder(null);
        prospectiveGuestButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                prospectiveGuestButtonActionPerformed(evt);
            }
        });

        currentGuestButton.setBackground(new java.awt.Color(255, 255, 204));
        currentGuestButton.setFont(new java.awt.Font("Comic Sans MS", 0, 18));
        currentGuestButton.setForeground(new java.awt.Color(102, 0, 0));
        currentGuestButton.setText("Current Guest");
        currentGuestButton.setBorder(null);
        currentGuestButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                currentGuestButtonActionPerformed(evt);
            }
        });

        employeeButton.setBackground(new java.awt.Color(255, 255, 204));
        employeeButton.setFont(new java.awt.Font("Comic Sans MS", 0, 18));
        employeeButton.setForeground(new java.awt.Color(102, 0, 0));
        employeeButton.setText("Employee");
        employeeButton.setBorder(null);
        employeeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                employeeButtonActionPerformed(evt);
            }
        });

        separator.setForeground(new java.awt.Color(255, 255, 204));

        chooseUserLabel.setFont(new java.awt.Font("Tahoma", 1, 24));
        chooseUserLabel.setForeground(new java.awt.Color(255, 255, 204));
        chooseUserLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        chooseUserLabel.setText("Choose User:");

        backButton.setBackground(new java.awt.Color(255, 255, 204));
        backButton.setFont(new java.awt.Font("Comic Sans MS", 0, 11));
        backButton.setForeground(new java.awt.Color(255, 255, 255));
        backButton.setText("Back");
        backButton.setContentAreaFilled(false);
        backButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout backgroundPanelLayout = new javax.swing.GroupLayout(backgroundPanel);
        backgroundPanel.setLayout(backgroundPanelLayout);
        backgroundPanelLayout.setHorizontalGroup(
            backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, backgroundPanelLayout.createSequentialGroup()
                .addContainerGap(333, Short.MAX_VALUE)
                .addComponent(backButton)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, backgroundPanelLayout.createSequentialGroup()
                .addGroup(backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, backgroundPanelLayout.createSequentialGroup()
                        .addGap(144, 144, 144)
                        .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE))
                    .addGroup(backgroundPanelLayout.createSequentialGroup()
                        .addContainerGap(101, Short.MAX_VALUE)
                        .addGroup(backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(currentGuestButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(prospectiveGuestButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(chooseUserLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE))))
                .addGap(99, 99, 99))
            .addGroup(backgroundPanelLayout.createSequentialGroup()
                .addGap(122, 122, 122)
                .addComponent(employeeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
                .addGap(121, 121, 121))
        );
        backgroundPanelLayout.setVerticalGroup(
            backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, backgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(chooseUserLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(prospectiveGuestButton, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(currentGuestButton, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(44, 44, 44)
                .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(employeeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(15, 15, 15)
                .addComponent(backButton)
                .addGap(11, 11, 11))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(backgroundPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(backgroundPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void prospectiveGuestButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prospectiveGuestButtonActionPerformed
        ProspectiveGuest PG = new ProspectiveGuest(reservationList);
        PG.setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_prospectiveGuestButtonActionPerformed

    private void currentGuestButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_currentGuestButtonActionPerformed
        GuestIDScreen GIDS = new GuestIDScreen(reservationList);
        GIDS.setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_currentGuestButtonActionPerformed

    private void employeeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_employeeButtonActionPerformed
        EmployeeIDScreen EIDS = new EmployeeIDScreen(reservationList);
        EIDS.setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_employeeButtonActionPerformed

    private void backButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backButtonActionPerformed
        WelcomeScreen Start = new WelcomeScreen(reservationList);
        Start.setVisible(true);
        this.setVisible(false);
    }//GEN-LAST:event_backButtonActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ChooseUserScreen().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton backButton;
    private javax.swing.JPanel backgroundPanel;
    private javax.swing.JLabel chooseUserLabel;
    private javax.swing.JButton currentGuestButton;
    private javax.swing.JButton employeeButton;
    private javax.swing.JButton prospectiveGuestButton;
    private javax.swing.JSeparator separator;
    // End of variables declaration//GEN-END:variables

    private ArrayList <Reservation> reservationList;
    private Reservation currentGuest;
}
